package com.onedec.account.service.impl;

import com.onedec.account.entity.OnedecAccount;
import com.onedec.account.mapper.OnedecAccountMapper;
import com.onedec.account.service.OnedecAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class OnedecAccountServiceImpl implements OnedecAccountService {
    @Autowired
    private OnedecAccountMapper onedecAccountMapper;

    @Override
    public List<OnedecAccount> findAll() {
        return onedecAccountMapper.selectByExample(null);
    }

    @Override
    public long accountnum() {
        return onedecAccountMapper.countByExample(null);
    }

    @Override
    public OnedecAccount selectByProjectId(int projectId) {
        return null;
    }

    @Override
    public void insertOne(OnedecAccount onedecAccount) {
        onedecAccountMapper.insertSelective(onedecAccount);
    }

    @Override
    public List<Map<String, Object>> selectByMap(Map<String, Object> map) {
        return onedecAccountMapper.selectByMap(map);
    }

    @Override
    public void deleteById(int id) {
        onedecAccountMapper.deleteByPrimaryKey(id);
    }

    @Override
    public OnedecAccount selectById(int id) {
        return onedecAccountMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updateOne(OnedecAccount onedecAccount) {
        onedecAccountMapper.updateByPrimaryKeySelective(onedecAccount);
    }
}
